def hanoita(n, a="a", b="b", c="c") -> None:
    if n == 1:
        output = a + "->" + c + " "
        print(output)
    else:
        hanoita(n-1, a, c, b)
        hanoita(1, a, b, c)
        hanoita(n-1, b, a, c)

hanoita(5)